import java.util.Arrays;

public class Test2 {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7};
        fun(arr);
        System.out.println(Arrays.toString(arr));


    }
    public static void fun(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] % 2 == 0) {
                for (int j = i + 1; j < arr.length; j++) {
                    if(arr[j] % 2 != 0) {
                        int temp = arr[i];
                        arr[i] = arr[j];
                        arr[j] = temp;
                        break;
                    }
                }
            }
        }
    }
}
